﻿//
// Copyright (c) 2024 BPer
//
#ifndef INCLUDE_BPERUTIL_SYS_BPERMESSAGEI_H_
#define INCLUDE_BPERUTIL_SYS_BPERMESSAGEI_H_
#include <stdio.h>
#include <stdint.h>

class BPerSysMessageI {
public:
	BPerSysMessageI(){};
	virtual ~BPerSysMessageI(){};
	virtual void success()=0;
	virtual void failure(int32_t errcode)=0;
};
struct BPerSysMessage {
	int32_t uid;
	int32_t messageId;
	int32_t handleState;
	BPerSysMessageI *handle;
        void* user;
};
class BPerSysMessageHandleI {
public:
	BPerSysMessageHandleI() {};
	virtual ~BPerSysMessageHandleI() {};
	virtual void receiveSysMessage(BPerSysMessage *psm, int32_t phandleRet)=0;
};
void bPer_post_message(int32_t st, int32_t uid,BPerSysMessageI *mhandle,void* user=NULL);

void bPer_post_state_message(int32_t st, int32_t uid, int32_t handleState,BPerSysMessageI *mhandle);
#endif /* INCLUDE_BPERUTIL_SYS_BPERMESSAGEI_H_ */
